package com.mianyang.zhangsan.model.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.mianyang.zhangsan.model.entity.SecRole;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
public class SecRoleDto {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("角色id")
    @TableId(value = "role_id", type = IdType.AUTO)
    private Long roleId;

    @ApiModelProperty("角色名称")
    private String roleName;

    @ApiModelProperty("角色描述")
    private String roleDesc;

    @ApiModelProperty("父级id")
    private Long parentId;

    private List<Long> authorities;

    public SecRole getRole() {
        return SecRole.builder()
                .roleId(roleId)
                .roleName(roleName)
                .roleDesc(roleDesc)
                .parentId(parentId).build();
    }
}
